Skip to content

Conversation

@DanBlackwell
Copy link
Contributor

@DanBlackwell DanBlackwell commented Nov 14, 2025

This sanitizer adds MTE (memory tagging extension) checks to stack variable accesses. Enablement simply requires setting an attribute on function definitions, and the instrumentation is added by LLVM.

The corresponding swift-driver change is at: swiftlang/swift-driver#2016.

rdar://161721201

This sanitizer adds MTE (memory tagging extension) checks to stack variable accesses. Enablement requires setting an attribute on function definitions, and the instrumentation is added by LLVM.
@DanBlackwell
Copy link
Contributor Author

@swift-ci please test

@@ -0,0 +1,11 @@
// RUN: %target-swift-frontend -emit-ir -sanitize=memtag-stack -parse-as-library -target arm64-apple-macosx10.9 %s | %FileCheck %s
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small nit: %target-swift-frontend inserts the target for the test configuration, given you're overriding it I think you ought to be able to use just %swift instead.

I think this test should probably also have:

// REQUIRES: CODEGENERATOR=AArch64
// REQUIRES: OS=macosx

Copy link
Contributor

@hamishknight hamishknight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small comment, LGTM otherwise

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants